package com.creative.accountsdk.net.account;

import com.creative.accountsdk.UmsChannel;
import com.creative.accountsdk.net.Protocol;
import com.creative.accountsdk.net.XParams;
import com.loopj.android.http.RequestParams;

import org.json.JSONArray;
import org.json.JSONObject;

/**
 * Created by wang_qian on 2015/11/30.
 */
public class ParentUnbindChildProtocol extends Protocol {

    private Long     childUid;
    public JSONArray  kidJsonArray;

    public ParentUnbindChildProtocol(Long childuid) {
        childUid = childuid;
    }


    @Override
    public RequestParams getParams() {
        return new XParams().put("kuid", childUid)
                .put(UmsChannel.PARAM_NAME, UmsChannel.getChannel()).
                        getParams();
    }

    @Override
    public String getUrl() {
        return getUrlPrefix()+"ui/unbind/kid";
    }

    @Override
    protected void parseReturnMap(JSONObject returnMap) {
        if (returnMap.has("kids")) {
            kidJsonArray = returnMap.optJSONArray("kids");
        }
    }
}
